package com.ki.erp.config;

import com.mongodb.client.MongoClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.mongodb.core.MongoTemplate;

@Configuration
public class MongoTemplateRegisters {

    public @Bean MongoTemplate userTemplate(MongoClient mongoClient) {
        return new MongoTemplate(mongoClient, "cola-employee");
    }
    @Primary
    public @Bean MongoTemplate erpTemplate(MongoClient mongoClient) {
        return new MongoTemplate(mongoClient, "erp");
    }

    public @Bean MongoTemplate orderTemplate(MongoClient mongoClient) {
        return new MongoTemplate(mongoClient, "cola-order");
    }
}
